﻿
namespace OpenComposite.HumanActivity.Contracts.Participants
{
	public class PropertyParticipant : IParticipant
	{
		#region Initialization
		public PropertyParticipant()
		{

		}
		public PropertyParticipant(string propertyName)
		{
			this.Property = propertyName;
		}
		#endregion

		#region Public Properties
		public string Property { get; set; }
		#endregion

		#region IParticipant Members

		public int ID
		{
			get { return -1; }
		}

		public string Display
		{
			get { return this.Property; }
		}

		public ParticipantType ParticipantType
		{
			get { return ParticipantType.PropertyParticipant; }
		}

		#endregion

		#region IEquatable<IParticipant> Members

		public bool Equals(IParticipant other)
		{
			PropertyParticipant otherprop = other as PropertyParticipant;
			if ( otherprop != null ) {
				return ( otherprop.Property == this.Property );
			}
			return false;
		}

		#endregion
	}
}
